import service from '../axios/index'
// 查询个人征信
function GetPersonCredit (data) {
  return service({
    url: '/mweb/contract/queryApplyListByCondition',
    method: 'post',
    data
  })
}
// 个人征信查看详情
function viewDetails (data) {
  return service({
    url: '/mweb/contract/checkContractDetails',
    method: 'post',
    data
  })
}
// 待录入合同base64
function ForEntryContractBase (data) {
  return service({
    url: '/mweb/contract/returnBaseStrByPath',
    method: 'post',
    data
  })
}
// 录入合同信息
function entryContractInfo (data) {
  return service({
    url: '/mweb/contract/completeCustomerInfo',
    method: 'post',
    data
  })
}
// 查询借款合同
function getBorrowContract (data) {
  return service({
    url: '/mweb/contract/queryBorrowListByCondition',
    method: 'post',
    data
  })
}
// 借款合同审核
function ContractCheck (data) {
  return service({
    url: '/mweb/contract/auditBorrowContract',
    method: 'post',
    data
  })
}
// 撤回合同
function SendBackContract (data) {
  return service({
    url: '/mweb/contract/cancelBorrowContract',
    method: 'post',
    data
  })
}
// 撤回合同
function downContract (data) {
  return service({
    url: '/mweb/contract/downLoadContract',
    responseType: 'arraybuffer',
    method: 'post',
    data
  })
}
/// //////////////////////////
// 个人征信审核
function PersonalCreditReview (data) {
  return service({
    url: '/mweb/contract/auditCreditContract',
    method: 'post',
    data
  })
}
// 查看合同详情接口
function ContractParticulars (data) {
  return service({
    url: '/mweb/contract/auditCreditContract',
    method: 'post',
    data
  })
}
// 删除合同
function DelParticulars (data) {
  return service({
    url: '/mweb/contract/updateForDel',
    method: 'post',
    data
  })
}

// 下载合同接口
function downLoad (data) {
  return service({
    url: '/mweb/contract/downLoad',
    responseType: 'arraybuffer',
    method: 'post',
    headers: {
      // 定义 post 请求编码格式
      post: {
        'Content-Type': 'application/json;charset=UTF-8'
      }
    },
    data
  })
}
// 分页接口
function nextPage (data) {
  return service({
    url: '/mweb/contract/SearchBypage',
    method: 'post',
    data
  })
}
// 上传
function uploadExcel (data) {
  return service({
    url: '/mweb/user/leadInExcel',
    headers: {
      // 定义 post 请求编码格式
      post: {
        'Content-Type': 'application/json;charset=UTF-8'
      }
    },
    method: 'post',
    data
  })
}

export { downLoad, nextPage, ContractParticulars, DelParticulars, uploadExcel, GetPersonCredit, viewDetails, PersonalCreditReview, ForEntryContractBase, entryContractInfo, getBorrowContract, ContractCheck, SendBackContract, downContract }
